import TipModel from "./TipModel";
import BaseView from "../../cfw/mvc/BaseView";
import { ResultState } from "../../sdk/SDKConfig";


const { ccclass, property } = cc._decorator;

@ccclass
export default class TipView extends BaseView {

	@property({ type: cc.Label, displayName: "content$VLabel" })
	content$VLabel: cc.Label = null;

	@property({ type: cc.Sprite, displayName: "left$VSprite" })
	left$VSprite: cc.Sprite = null;

	@property({ type: cc.Button, displayName: "left$VButton" })
	left$VButton: cc.Button = null;

	@property({ type: cc.Sprite, displayName: "righ$VSprite" })
	righ$VSprite: cc.Sprite = null;

	@property({ type: cc.Button, displayName: "righ$VButton" })
	righ$VButton: cc.Button = null;




	protected model: TipModel;

	onLoad() {
		this.content$VLabel.string = this.model.getContent()
	}




	onDestroy() {

	}

	onleft$VButtonClick() {
		this.hide()
		this.model.getCallback()(ResultState.NO)
	}

	onrigh$VButtonClick() {
		this.hide()
		this.model.getCallback()(ResultState.YES)
	}



}